added has component and panic if nil component is passed.
added IsDupErr check and nil check for not found err check
simplified new doc check code.
layout fix
added err nil equality checks
simplified - nil does not match/equal.
simplified code