Bugfix: The substring extraction failed under some versions of bash