Fixed a messy security bug

Because a view will be returned in the HTML until the position where an error occurs (e.g. undefined variable) I like to pull this merge request to fix it.