Some code cleanup, documentation and fix for Release configuration