Added integration tests. Closes issue #12