Fix a cast error and check UUID size.