[BUGFIX] Temporarily make all methods public again
[BUGFIX] Replace undefined variables with globals

Change-Id: Ic596f01b396360843563cc43b0b0474f4118c214