Minor bug fixes, and added a random (rdm) command