Not that I am ready to catch your error (please show a place where your subroutine "Raw" is called), just a few thoughts:
did you checked that your uid, attr, category are in correct order? I noticed that different subs have different order for them. This will not directly cause sympthoms you described, but I thought may be you did a typo here?
please show a place where your "Raw" method is called (as I already mentioned)