htofix typings and typescript 1.3 compilation