Fix JS type check