Minor rewriting.

- Added Debug.Assert.
- Defined text Resources for errors.