Restored deleted or commented functions (see cleanup changeset 3918dc8abb07)