Fixed parameters compliance checks when linking. Also cleaned up some code.