Couple bug fixes in controller