Fixed an undefined index error.