added some test cases, based on bug report