Core pr 5

Fixed some user redirects and coding style.
I think it's due to "Hook init is not run on cached pages."