Handle port disconnect

Closes #5