Logging cleanup and fix for zombie process issue