I'm not familiar with the Vivitar flash, but it may have limited "communication" abilities with Nikon cameras. I believe that the pop-up flash (and the SB-400) operates in TTL-BL except when using spot metering, then it will use TTL. Perhaps the Vivitar works this way, too. If you are getting better exposures at larger f/stops, the distance may be too great for the power of the flash. At f/10, you may have to be fairly close to your subject, or bump up the ISO.
To get the most out of Nikon's flash system, I would recommend a Nikon flash. The SB-600 isn't too expensive.