fix mismatched #end in SWIG template