Fixed bug with count of obstacles