Update Thread.php

Bundle crashes when trying to access the first and last element as objects (because it returns an array with pointers, but you are not able to access the methods of the first and last element of the array). This correction returns the actual object, and not an array with the pointer.