Most of the testing here is manual. We should implement a test framework and gradually increase the coverage.