Small fixes

Fixed a NPE on connection failure
Fixed a test dependent on scheduler magic (failed for me)