Amqp fixups

@dblundell, could you please have a look at these 2 patches ? Thanks !