Better error reporting and bullet-proofing.