Improve UUID support

Fixes #912