Bugfixes and TODO items added.