Made a number of changes to improve cross browser behavior