Tighter testing and better logging.