Tried to fix some cross-browser issues.