fix aliasing violation

Thanks jsnweitzel