Remove undefined when no before/after template