Adding config validation. Fixes #8.