Don't use the nonstandard __FUNCTION__ macro
Use expr instead of $((...)) in shell scripts

For Solaris 10 compatibility.