Improves whitespace handling, disconnect

Both of these things still need improvement.