Add sanity checks on callbacks