Fix saving for quantityvalue datatype, added enum for the forthcoming units