Fixed uninitialised string
Fixed memory leak
Added deref and struct sizing bugs