Fixing redirect errors