Split init code to work around a delayed layout issue in some versions of Chrome.