Fix issue #538

Sorry, last pull request didn't solve the problem.