Fixed return type of tasks. Fixed email and posting invoices