[Core] Minor code cleaning

And trying to fix the unit tests