Properly shift ulongs instead of chars.  You can't shift an 8-bit value ...

...by 56...