another precache fix
fixes for refunded credit
more fixes and test for credit refounding