Fix unofficial message dependency generation.

Cherry picked fixes from hydro to bugfix #12 and #14.