Some test cases. 27102013

Some test cases, and fix.