Tests and bugfixes
Updated test app