fixed some simulator bugs