Bugfixes, updated README, added test files