added realloc test and cleaned up warnings