fix O_RDWR in command_calc_batch(): would invalidate file
remove debug statements