Moved all debug messages to a custom function.
Minor ACL fix for dir walking. Also replaced debug messages with dedicated function.