Little distance calc bugfix and minor ui improvements.