Added a BaseController class, and minor corrections.