added missing handling for Buffer objects