added the assert for checking the pointer in various part of code
added padding to unsafe header