Bugfixes and testing
Adding test files