Enhancements on the button control code.