Fix condition where captures could be a nil rather than an empty map.
Merge branch 'dev' into features/amqp-plugin