Army finds a fix for safety failures in M4 and M4A1 rifles