more test cases and fixes to code for ReBin() math utility