Fixed multiple layout extension issue for swig templates