Fix misalignment issue, other fixes

Signed-off-by: Vivek Rai <vivekraiiitkgp@gmail.com>