Remove warnings by adding missing definition for Linux and header
Remove more warnings
Remove invalid read when the pointer does not hold the wanted size
Remove leak