Add a test for Problem class, and fixed a bug.