Moving error printing into its own module.