Fix PHP fatal error when updating redirect counter