Fix efficiency problems with auxiliary variables