Added tests for publication controller, other minor fixes