Better error function.