Not to mention that nearestobject to an object (not a position) will (unless a specified classname to search for is given) allways return the object itself. Its a pain really, for example of you use:
nearestobject [player,""]
It will return as player, no matter how many other objects are next to him, because think about it, the absolute closest object to the center of player would be player. :-\ Sometimes OFP is too logical...