Add resolve test cases / bug fix