Applied patch from Fredric for Coral.
Merged Fredric's changes to CORAL.