When saving buttons by screen, buttons were stored in a HashMap which doesn't maintain order. Closes #3916