Fix issue that passed invalid UUID string.
Add test cases.