Added a check if -x is not set 'nextManifestFilePath' shouldn't be null/empty

Removed conditionals surrounding usage of manifest object. The manifest object instance is created, populates, but doesn't save when -x is set.
Recreated author's code-style regarding { } brackets.
Created a local variable to avoid potential 'access to modified closure' in one of the for each loops.