cast correctly to fix compiler warning on 32bit PAE
added test to match the C tests; but they FAIL!