-Added the description for the -v option
-Fixed wrong array indexing
-Fixed a NULL pointer dereference
-Fixed wrong return value
-Added some free()s, to clear some memory.
-Removed -W, because -Wextra was already in the CFLAGS