Fixes warnings.
Removes duplication.