Fixed warnings.

Also formatted code :)