Controller fixes (thanks @mathewlenning)