Some changes to get flashing working on Mac