fixed typescript merge errors
merged with alexzen
fixed more errors
fixed few errors in typescript
merged with Michael