Moved link_error to its own header file.
Added tests.