Small enhancements to the main method.