Nil check

Issue #64 wasn't fully resolved. Need to check for valid object before dereferencing because dereferencing nil is bad.