fix SIGFPE caused by a now invalid reinterpret_cast