Fixed up some invoicing bugs