Revert "Fix wrong sizeof argument"

This reverts commit 55b3d355c199367f8f5df1e356a99049f5ca6ae0.
Redo 55b3d355: Fix wrong sizeof argument

This fixes #9618