Added bugfixes from main app