Restored some missing code and clarified some other.