Fixed a couple of errors encountered when loading views