Fixed some browser-specific stuff that led to failures in Chrome