fixes some javascript issues highlighted by iPad not working