Exception-like handling added.