Improve compatibility & fix warnings.