fixing exit code on test and adding debug for secure vars