minor changes

- small bugfixes
- added comments