Bug fixes and comments