Fixed sending of invoice (multiple minor bugs).