Fixes github issue #72
Fixes github issue #66