SWF: fix error handling