Linux64 fixes
Cast to ubyte
Hack around vtable emission problems