Dependency on 'magic' setting 

The script breaks when `nomagic` is set. This  pull request fixes that.