Added location dialog, and a few tidyups