Cleaned up X error handler work.