fixed issue with empty args array and added test coverage