Improved Z-scan adjustment to thermal nonlinearities by including nonlinear absorption