Removed some warnings, checked for errors with malloc