various fixes and indentation fix