Some fixes for tsc 0.9.5.0

Hi,
here are some fixes made while trying to make it work with latest version of tsc. See Donadeo's issue for the last remaining bug, I'll describe it there.