Better error handling for define and head.