Changes to help Firefox compatibility

Not working correctly