Fixed malloc bugs (oops, not great at c when I wrote that), rounding discrepancies, and added custom message support in case not all your base r belong to us