Various bugfixes. It works, now.