Fix up action error handling and improve tests.