Fix crashes in GUI button.