Fixed undefined indexes on cases where plugins did things wrong