Added implementations for various functions left out in the previous commit.