Fixed modules checking not includding 9
Rewrited trashing function, optimisations