Fix bug in address resolving