Updated to work with TypeScript 1.0