Synched changes for #217 with ml.bat