Fixed browser issues and added tests