Fixed several errors with TypeScript0.9.5.
Merge pull request #1406 from gyohk/switch-0.9.5

Fixed several errors with TypeScript0.9.5.