Fix to button generation