Fix port=None bug