Fixed a bug with invoice status changes