Bug correction in Invoices class

There was an error in Invoices class, leading to an undefined result if
the user was not in the invoice.