Added testcases for bugfixes