Fixing issue #473, avoid infinite loop