minor fixes
misc code changes (required to create quasy-working version of TM_4.0_Design)