Fix custom-filename function usage as ~ is causing problems with midje