MT#5299 API: more billing tests and bug fixes.