Various fixes to previous commit.