Fix locations without parents and general cleanup