Fix to bugs with validation

Internal validation would accept non d-codes

External model would not properly parse period