Bugfixes and little design corrections.