Fixed template variable output. Fixed tests also.