fixed dumb multi-threading mistake and changed handling of ways with empty names (might make no difference)
added comments and such