Nearly finished functions and some source code consistency changes.