Changes to maxResultSize code (improve error message and add condition to check if maxResultSize > 0)