Fixing issues #24 and #79