bugfix: NPE when using foundation layers

first and last were not set
bugfix: small open polygons were not printed completely...

...instead the last path (back to the starting point) was an air move.
Now all printing moves are done within the loop.
Sorry: small cleanups, I didn't bother to separate, come along with this
change for free...