Typo corrections and logic block change 

Testing for $DAEMON should happen after /etc/default/nginx is loaded, otherwise that variable can't be overwritten.