errors from 'which' fixed