Functions I'm using (I don't know if perhaps one of these is causing it):
strun()
systemtest.JSimulink.stcvhtml()
rmdir()
cd()
load_system()
set_param()
rtwbuild()
Simply opening Matlab and running quit does close it properly. It doesn't close after something of the above?