Added primitive date, improved value getter function