More safety checks - here for software dependencies.
This change was needed to get the project to compile.

Without it the build failed saying it couldn't convert Object to String.
Made sed usage more portable.