Added some error functions.