Fix undefined index on non-valid head info