Fixed bug in random weight creation.