Added more tests and browser compatibility