Fixes Issue #24 and #17