[Core] Fix return wrong count