How to fix EPS with incorrect bounding box?

This seems to be because EPS (and PDF) uses PostScript points (=1/72in, called bp (big points) in TeX), not the normal TeX points (1pt=1/72.27in). The EPS contains its size (bounding box) as integers, so rounding the size upwards. You can try and add the hi-resolution bounding box header which contains the size as floating point numbers. However, it depends on the used tool which of the two are used.

You can get these headers calculated by Ghostscript using:

gs -dNOPAUSE -dBATCH -q -sDEVICE=bbox file.eps

which prints the required EPS headers:

%%BoundingBox: 0 0 34 31
%%HiResBoundingBox: 0.000000 0.000000 33.317999 30.005999

You can then simply replace the original headers with the updated one. There might be tools which do this for you (e.g. eps2eps) but these might actually change the font settings etc. I wrote my own Perl script called fixbb once which does nothing else then calling gs like above and replacing the headers. (But I'm just seeing know that it doesn't add the HiResBoundingBox header if it wasn't use before.)

As workaround you could make sure that your diagrams are drawn using bp not pt, at least the outer rectangle.

BTW: I would use \documentclass[border=0pt]{standalone} instead. This saves you some steps (e.g. page style is already set to be empty, ...). However, I still get a white border at the right and top.