Merge pull request #273 from akofink/master

Bug fix for #270 and #272.