fix errors and warnings from safari 5