I'm starting to use this extension a lot and I've found that if you print the SQL that has been modified by the SB to the screen you can usually see what the problem is.
Each case would be different but if you look at this line of code:
$inv = mysql_query($query_limit_inv, $BEA_PHP) or die(mysql_error());
The query is "$query_limit_inv" so if you echo that you will see the modified SQL.
Thats my tip for the day. :)