Fix failing tests, make the onerror and onload tests more comprehensive, remove broken onload function call.