Fixed memory corruption, wasn't mallocing enough space for the null terminator -.-