Added a simple test for objective function.