Clean up _getCachedBounds() code.
More matrix related clean-ups.