Fix for issue#343, added new test cases for core