Fix warning and remove trailing white spaces.
Add configuration validation class

  Make validation of configurations more flexible for users.