Some sizeof() bugs fixed

Based on a similar diff from github.com/henu

Signed-off-by: Gregor Best <gbe@unobtanium.de>