Fix bug with invalid commands