Bugfixes and more tests
Adding more test samples and bugfixes