some small cleanups

replace "UV object is not in a valid state" assertion with an error message,
since it is possible to trigger these from user code.