Optimizations to simplification and solver fixes.