Fix fatal bug in Get*LineWithDirection
Fix fatal bug in Brain