Added error tracking to num.c (accidentally) and fixed main.