Merge changes from upstream. Closes issue #2.