Random Movement Generator fix and issue #152 fix

Redone my previous commit for Rel19 branch as requested.