Some invoice-related fixes