[ML][Train] Unify thrown exceptions and some fixes.