Fixed #229, Fixed #164

Hopefully everything still connects properly because I can't test it
from home.