Adding verbose mode; fixing NULL pointer issue