Fix bug with checking current patient for null when it was really undefined