diff --git a/modules/Makefile b/modules/Makefile
index 8e47224583a6329160b8995911f7a4f29574c433..93289a0c6704fea8e47f7fe8adbd9edd7c3dffcb 100755
--- a/modules/Makefile
+++ b/modules/Makefile
@@ -3,7 +3,7 @@
 
 # Make instructions for smoke testing Puppet manifests.
 # Copyright 2013 - 2015 Ulrik Haugen
-# Copyright 2013 - 2014 Linköpings universitet
+# Copyright 2013 - 2015 Linköpings universitet
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the Gnu general public license as published by
@@ -167,8 +167,9 @@ osfamily := $(shell facter osfamily|tr A-Z a-z)
 
 # Possible values for fakeroot are: fakeroot, fakeroot-ng
 # (nonfunctional), empty (noop) and sudo.
-# Sudo will require a line like
+# Sudo will require lines like
 #  %puppet-devs ALL = (root) NOPASSWD: /usr/bin/env * puppet apply --noop *
+#  %puppet-devs ALL = (root) NOPASSWD: /bin/chown -R * smoke-testing-state
 # in your sudoers configuration. Beware though that this will let all
 # members of puppet-devs trivially escalate their priviliges.
 # Set it to empty on Centos/Redhat and fakeroot elsewhere.
@@ -209,8 +210,9 @@ puppet-paths := --confdir smoke-testing-state/etc \
 # Apply test manifests with specified environment:
 %.testoutput: %.testenv smoke-testing-state/share/global.testenv smoke-testing-state/etc/puppet.conf smoke-testing-state/var/lib/puppet smoke-testing-state/var/run FORCE
 	cat $< >$@
-	env `cat smoke-testing-state/share/global.testenv` `cat $<` \
-		$(fakeroot) puppet apply --noop \
+	$(fakeroot) \
+		env `cat smoke-testing-state/share/global.testenv` `cat $<` \
+		puppet apply --noop \
 		$(puppet-extra-args) \
 		$(puppet-paths) --verbose --color no \
 		$(basename $*).pp >>$@ 2>&1 \
@@ -218,8 +220,9 @@ puppet-paths := --confdir smoke-testing-state/etc \
 
 # Apply test manifests without specified environment:
 %.testoutput: %.pp smoke-testing-state/share/global.testenv smoke-testing-state/etc/puppet.conf smoke-testing-state/var/lib/puppet smoke-testing-state/var/run FORCE
-	env `cat smoke-testing-state/share/global.testenv` \
-		$(fakeroot) puppet apply --noop \
+	$(fakeroot) \
+		env `cat smoke-testing-state/share/global.testenv` \
+		puppet apply --noop \
 		$(puppet-extra-args) \
 		$(puppet-paths) --verbose --color no \
 		$< >$@ 2>&1 \
@@ -292,14 +295,12 @@ smoke-testing-state/share/global.testenv: smoke-testing-state/share/global.teste
 		echo -n "FACTER_$${envdef} "; \
 	done >$@
 
-smoke-testing-state/var/lib/puppet:
-	mkdir -p $@
-
-smoke-testing-state/var/run:
+smoke-testing-state/var/lib/puppet smoke-testing-state/var/run:
 	mkdir -p $@
 
 clean:
 	rm -f $(testartifacts)
+	$(fakeroot) chown -R `id -un` smoke-testing-state
 	rm -fr smoke-testing-state/share/global.testenv \
 		smoke-testing-state/var/lib/puppet smoke-testing-state/var/run \
 		smoke-testing-state/var/state smoke-testing-state/var/reports