Bugfix: top layers were not detected correctly, causing overlap of support material and object in some situations where there were contact regions having the same Z as some top regions