Small fixes: check if dataobject is null and deleting an invoice. Still not working properly.