Well, I did a dropdb and then I recreated everything, and then it started working the way I thought it should. There must have been some function in there that was confusing it, or who knows what. As I'm writing and debugging functions, I do a lot of DROP FUNCTION and CREATE FUNCTION, so maybe something happened. Strange.