Fix errors thrown during commands

Also remove the debug code
Merge branch 'develop'