Fixed small bug in templates