Fixes: total limit query logic and overloading compile issue