Fixed wrong return statement, closes #756.
Merge pull request #874 from cmfcmf/categories-fix

Fixed wrong return statement, closes #756.