fix template defines