dclass: Bugfix, fix misc bugs to satisfy all unittests.