Misc stuff

Miscellaneous fixes and cleanup made while trying to fix this IE8 issue.