Some bugfixes to make it compile with TS 0.9.1.1

Was trying your great compiler plugin :+1: 
Found some issues that i this PR resolves.