fixes and improvements for TGMP