Type definition cleanup and sound read potential leaks fixed
More fixes, hell what a trip