Missing global $post declaration

On a page generated by archive.php (and possibly others) with DEBUG enabled an error is generated. This is due to a missing $post global declaration.

Simply adding in this declaration into functions.php removes the chance of that error generating further conflicts.

Miscellaneous other files might be included due to permissions changed on my local development system