Merge pull request #31 from ADmad/develop

Complete change started in previous commit and update tests.