Exception handling improvements

closes #14