fixing boundary treatment for edges in 3D
Merge branch 'master' into boyceg/reduce-memory-use