Cleaned up code; added error messages for invalid commands
Merge remote-tracking branch 'origin/master'