Adding some initial unit tests and fixing a bug where Category was not logged