patch for most obvious errors