Fix IndexError error when no args are provided