Change diameter code to 'D'

For some reason that I can’t figure out, the decimal is dropped when
using ’S’ for the code.

Also some minor code improvements to M200.