Added a new test. General troubleshooting and bugfixes.