Fix notices of 'Undefined index'