Fix compilation errors with TypeScript 0.9.1

Fix compilation errors due to differences in TypeScript 0.9.1 but the example does not run as intended.