Command generations fixes. Code reformat.