Added extra error checking to dictionary script plus human-readable error on failed connection.