bug in functions.js: Cannot read property 'replace' of undefined

Signed-off-by: Marc Delisle <marc@infomarc.info>
Fix merge conflict

Signed-off-by: Marc Delisle <marc@infomarc.info>