Used the wrong reference to test command and got an NPE
Make command reparsing work properly, and general cleanup