Improve compatibility with Safari