Functions to run-time type check and convert AbstractUniforms.