Allocate memory for parsers and classifiers correctly