Fixed some undefined index errors