Fixed bug in DM simulation