Fix the batch mode of the post command and the attach command.

This code was attempting to access attributes of the connection object
which did not exist.

This fixes #73.