Updated errors to be housed inside of functions.