Windows fix

Moved GError declaration to ensure Windows doesn't explode, and
partially reverted previous commit