misc fixes and added comment