Fix bug & add more tests to view engine