Minor style and code motion.
Remove old (unused cruft) which was unreadable.
Small tweaks. Removed a redundant operation and added some comments for future work.
Added a message for wrongly numbered verices.
Minor tweaks.
Merge from master.