Using connect() in initialize().

Fix for issue #2884.