I had issues with not getting my diapers clean enough too, resulting in strong ammonia smell when bb pees in it. I recently revamped my wash routine and it has helped A LOT! Occasionally, if i have too many diapers in there, I still run into trouble, but mostly they are good. Here is my new routine:
I set my washer to WHITES setting and on a 15 minute cycle.
Cold water rinse and spin
HOT ( I turn up the water temp to 120- this really made a difference for me) wash with 1/2 scoop of country save detergent
Cold wash with no detergent
Cold water rinse and spin IF needed
Could it be that your water is not hot enough? I've found that when mine isn't, like if i forgot to turn up the heat, the diapers don't get clean as well. Hope this helps!