set global variables to NULL before use and change schema version

Issue: GCP-1029

Reviewer: Dennis