Initial implementation.
Fix warnings.