Check for d and use kmScalars
Merge pull request #25 from Cloudef/master

Check for d and use kmScalars