Fixed with port condition and cleaned up code
Renamed vars
Merge branch 'bvklingeren-master'
bumped version in pom