Fix window.angularReady undefined and timeouts