Resolve base directory
Ignore no-loop cases
Run and shutdown process correctly
Add missing require