Fixes for location and xml handling