Fixing global declarations and #includes.

Got to compile this file again. Now with the correct types of the
extern variables.