Added more error control in view file parser; some code cleanup