Fix for zero length files created by Windows New Context menu + code cleanup of affected functions