Some minor bugfixes and some redesign