Fix some maths.
Add missing files.