Bug fixes for Safari

Bug fixes for Safari