Fixes some validation problems and adds lang support for validation errors.

Part of issue #20.