Partially fix issue #157