FIx runtime types problem with compilation to js.