Minor fixes to startup
Handle location allocation and closing