Added some validation to the template url position hash
and some small fixed in manager.cpp