More useful error messaging around invalid formats