I would have a look at the following :
- whats are you doing the regular expression bits ? are they necessary ?
- missing ul tag could be an issue
- query_posts is a bit dodgy overall for something like this and you really should change to using WP_Query to avoid all sorts of voodoo mischief, its the better way to run multiple loops and I suspect, as query_posts hijacks the main query, doing this essentially inside of another loop may be whats causing all sorts of tom foolery.
Good luck.