Fixes for random test behaviour. Removed unneccessary em.clear()