Remove two errors showing up in Safari

With these changes it works on both Safari and Chrome. I don't have access to IE to test.