Handle random slopes in nlme

Modified function to correctly calculate random components in a random slope model using nlme package