Added null trap code for debugging. (Must be included by adding