More debugging, fixes to location saving