Mopping up: corrected file modes, removed debug logging