Fix some redirects, fix ifs, fix padding