Fixing wait vs deref