Fixed all of the button logic.