More accurate comments and minor optimizations in BaseController.