Bugfixes to new classification functions.