Improved exception handling of the configuration and added listeners.

Signed-off-by: Xunkar <xunkar@jenmaarai.com>