Add missing misc. things.
Remove some redundant code.