Fix for update. Added tests. closes gh-38