fix bugs in grain size scaling