Better error message for bad data types in define

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