Fixed Context import
Checking for edges length to avoid empty buffers