fix issue #24 on branch 0.6