Fix some compile errors
Fix wrong size check
Remove meaningless paddings