Addressed edge cases for commands

Addressed some possible edge/special cases that may arise, and prevented
server crash.

Behaviour upon encountering edge case might not final