diff --git a/include/opendrive_object.h b/include/opendrive_object.h
index 88041848d61fca9ccdb66e51898091c899a67cec..3a0d30f85688623fc5409a17d3cc06dc2ce98587 100644
--- a/include/opendrive_object.h
+++ b/include/opendrive_object.h
@@ -68,6 +68,7 @@ class COpendriveObject
     bool is_box(void) const;
     bool is_cylinder(void) const;
     bool is_polygon(void) const;
+    bool is_parking_space(void) const;
     TOpendriveBox get_box_data(void) const;
     TOpendriveCylinder get_cylinder_data(void) const;
     TOpendrivePolygon get_polygon_data(void) const;
diff --git a/src/opendrive_object.cpp b/src/opendrive_object.cpp
index 48cb8c542d87c34612805c6e8b7dbc5baacba49d..580d41f8df3471bf34a6d82182179ce75aec981e 100644
--- a/src/opendrive_object.cpp
+++ b/src/opendrive_object.cpp
@@ -187,6 +187,14 @@ bool COpendriveObject::is_polygon(void) const
     return false;
 }
 
+bool COpendriveObject::is_parking_space(void) const
+{
+  if(this->type=="parkingSpace")
+    return true;
+  else
+    return false;
+}
+
 TOpendriveBox COpendriveObject::get_box_data(void) const
 {
   TOpendriveBox data;
diff --git a/src/opendrive_road_segment.cpp b/src/opendrive_road_segment.cpp
index 3326af63e96977180b265c1d3f819575a063e0da..bfd6b041e88d7cf8a39a289c190883adafcd6f79 100644
--- a/src/opendrive_road_segment.cpp
+++ b/src/opendrive_road_segment.cpp
@@ -853,7 +853,7 @@ std::vector<const COpendriveRoadSegment *> COpendriveRoadSegment::get_prev_segme
     for(unsigned int i=1;i<=this->get_num_right_lanes();i++)
     {
       const COpendriveLane &lane=this->get_lane(-i);
-      for(unsigned int j=0;j<lane.get_num_next_lanes();j++)
+      for(unsigned int j=0;j<lane.get_num_prev_lanes();j++)
       {
         already_present=false;
         for(unsigned int k=0;k<segment_candidates.size();k++)
@@ -875,7 +875,7 @@ std::vector<const COpendriveRoadSegment *> COpendriveRoadSegment::get_prev_segme
     for(unsigned int i=1;i<=this->get_num_left_lanes();i++)
     {
       const COpendriveLane &lane=this->get_lane(i);
-      for(unsigned int j=0;j<lane.get_num_next_lanes();j++)
+      for(unsigned int j=0;j<lane.get_num_prev_lanes();j++)
       {
         already_present=false;
         for(unsigned int k=0;k<segment_candidates.size();k++)