Bug fixes and more comments