Improved check of "limit" parameter