Many runtime bugfixes