Cleanup, make things work, add useful log messages.