Changes to conditional moved null check to the wrong place - causing null ref exceptions.  Moved null checks back up to top of resolve method.