Fix handling of ListOpts

As reported by Selvakumar Arumugam <selvait90@gmail.com>,
ListOpts were being written in a python list syntax, rather than the
expected comma separated list.

Selvakumar produced and tested the code for this fix, which is much
appreciated.

This patch adds another minor fix: adding a space between the option
type and the value