Thanks for the solution, Dellbridge. Your code swap worked for me.
Here was my situation. I added a few new Post Types. I was getting the 404 error when trying to see the list in the Admin (edit.php?post_type=myposttype) when there were no posts. It should just show a normal page with no posts, and a message saying no posts found, or whatever you specified in register_post_type label ‘not_found’ value.
The really strange thing is that when I viewed the page with the web browser on the server itself it worked just fine, no 404. For the record I’m using WP 3 on iis7, and the rewrite rules generated by wordpress in the config file. So it seems that it’s something to do with the rewrites, permissions and this line of code, but I am at a loss as to what it is.
Definitely something to fix for the next version. I really didn’t want to have to tell the client to ignore the 404 and to just add a post to make it go away, very tacky.