Fix compile issue, test failing issues and test context loading issues