Change some logic of disabling buttons and repair non working code.