Fix a bug with Limit clause