Bugfixes for windoor construction.
Code cleanup.