Fix bug where UVP would return non-NULL handle in case of failure