Minor revisions on the functions.