Fixing strange bug with $user not being set correctly at page load.