Sorry the comment is a bit cryptic, but the "options.table" was not being quoted as an "AS" statement in a subquery.  If you remove it, and run the tests you will see what I mean.