Bugfixes and comments added