#2925: changed random initialization of parameters and fixed two non-critical bugs in the implementation