Minor improvements

I know it's a small script, but I found it useful. Here are some minor improvements. The recursion fix was an important for me since I aim to use this on a larger music library.