Add edge extremities and fix minor bugs