Modal fixes, general bugfixing