Better sanity checks and error messages in PBF writer.