Merge changes from DanWBR/dwsim3