invoices several bug fixes