Bugfix

Fixes errors in bitwise type conversion.