Second round of performance optimizations. Removed test_all_combinations option from var_main.