Add tests for optimen