Fixed Safari bug that broke things during state handling.