doLibPaths function

Deals with missing libPaths arg, and takes first