Fix error when "puppetmaster" is undefined
Also fixes warnings due to missing "@" before the variable names