fix type conversion and missing forward declaration warnings