Fixed a console bug.
Fixed two long-standing cavity rule bugs.