minimise use of assert(), particularly assert(false)