Plus minor dug fixes and renaming of variables. Former-commit-id: 93b063885976e656f7e28e05620f59b8225720d6