Improve LIMIT error handling
Add unit tests for client-side expressions