Fix #1005: Don't allow strings as values in quantities