many fixes regarding compatibility with older browsers