More bugfixes. Currently working.