Fix pointer conversion warnings
Check for headers which may or may not be available
Whitespace fix