I received the following error on one of my sites that I was experimenting updating to 2.0. The errors seems to be caused because we are assuming that a userid of 1 will exist. I am not a fan of having a hard coded id listed in the code. Might it be better to use something like $USER->id instead? Although looking at the code, I'm not sure it is worth adding in the global $USER to the function. Perhaps there might be a better way of grabbing a user such as deleted=0.
Peace - Anthony