Fixed php warnings or undefined indices.