fix gcc warnings

this fixes gcc "shift" warnings and adds more test cases.