Created a macro for throwing invalid_arguments. (with function name).
Made the correlation registration use the inverse