Fixed signed-byte bug

This is a bit tricky, you need to do (byte & 0xff) to get its unsigned value.