Fix unchecked reallocs
Added build.sh for test files