Ported over index.php changes