An attempt to fix issue#3368

I have tried to fix issue #3368 (BUG: ma: Inconsistent return type from the 'count' method.) raised by @WarrenWeckesser
The code has become ridiculously simple but I think it may affect some functionalities, though I couldn't find any. Please look into it