Fixes for new Triangular class and other cleanups.