Make gem more robust

- proper exception handling
- improved parsing
- configuration feature fixed