Improve errors, cleanup.