Add an assert()
Fix typo in logging and improve it to match the actual function name