Refactored a bit.
Cleanup: silenced warnings.