Fixing issue #166
Fixing issue #163