Fixed not being able to reuse ports and fixed crash