small bug in reading templates from files