Loc upload

Fix two bugs related to location upload/download.