Fixed compile errors with the newest typescript