Cleanup, latex, error handling.