Manually merged PR #14 and updated tests to make them work. Closes #14