Added getName functionality and fixed a glibc error (still has memory leaks)