Fix functions, scripts, and add global simplecov