Various fixes that were necessary because of previous changes.