Fixed undefined index warnings when debug mode was on