Fixed bug in line of sight detection