Fix button states

Cherry-picked from #11