Adding test for optimize call
Merge pull request #521 from liip-forks/fixing-optimize-functions

Adding test for optimize call