Fixed location refactor bugs