More Improvements

More test case, performance ditch and bug fixes