Implements tests for MainController, fixes builds