Raise error instead of returning NULL, when appropriate