fixed error where page type loss on saving page

when saving a page the type of the page was reset to file and not
preserved.
fixed template node retrieving test
small syntax correction