Fixed a bug in randomise