Fix compiler warnings.
Fix incorrect code.