Update polynomial.c

Added error checks to various functions