Wrong variable was logged.
Merge pull request #301 from Levino/fixwrongerrorlogging

Wrong variable was logged.