Fixed some test cases and
fixed update issue