Fix typo in foreignkey name
Minor fixes to ApplicationController - still needs a cleaner implementation