Some bugfixes done.