Improvements to ML plugin