fixed error checking and some errors in puppet config