bug fixes, comments and clarifications