ns.m still had problems with empty errors. This is more roboust.