Add test cases for issue #11, issue #12 and issue #13