Bug fixes for accrual based accounting