fixes some bugs introduced by the -c option