Changed debug env var check to not throw errors when variable not set