Better error message for bad data types in define

I'm not entirely sure how useful this is, but I saw an open issue and thought I could help out.