fix return statement for generated template definitions