Rewrite minimization test
Trying to fix minimization
More refactoring
Fix minimization problem, finally
Fix failing test, get rid of print statements