Fix bugs when enabling/disabling buttons