Minor bug fixes with cmd