Fix error reporting in edge case