Improved handling of uuid value and casting