Bug fix in get horizontal and get diagonal