Slight modification to basename check for sourcing directly in shell.