Added BaseController tests and fixed some mistakes in it