Test cases bug fix