Add some debug messages in. Make client_prints for each possible situation that could be bugged and check to see what isn't valid or isn't being cached correctly.
I'd add some checks in for validity of the entity and its owner first.
__________________
[ Paid Requests ] DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT