more fiddling with resolution of references.
Also fixed issue with cell alignment.