Some minor changes and new functions.