Merge pull request #2377 from alex/internal-error

Use InternalError for stuff