Cant get atoi working properly, it always segfaults...