Attempts to fix the deref_* functions.