Fixed bash options and improved code readability