Bugfix with parsing command messages

Added a test case, and also fixed a logging message's format that was
breaking the test suite