Fixed a couple of bugs in CoreCommandProcessor and added tests.