Fixing compatibility issues with Safari