calcgrade bugfix and improvements