applied slightly edited patch to suppress strict-aliasing warning