Fixed redirects, added logging