Minor improvements to main file