Define conversion routines I'd forgotten to write.